

<canvas id="myCanvas" width="1920" height="1080"></canvas>

<script>

    var brid = {
        x: 100,
        y: 50,
        move: function (ctx, xx) {
            ctx.beginPath();
            ctx.arc(this.x, this.y, 40, 0, 3 * Math.PI);
            this.x += 5;
            this.y += 0
            ctx.stroke();

        }
    };

    var canvas = document.getElementById('myCanvas');
    var ctx = canvas.getContext('2d');

    let lastFrameTime = 0;
    const targetFPS = 1; // 目标帧率
    function animate(currentTime) {

        brid.move(ctx, 0)

        // 计算距离上一帧的时间间隔
        const deltaTime = currentTime - lastFrameTime;
        // 计算当前帧率
        const currentFPS = 1000 / deltaTime;
        // 在这里执行你的动画逻辑
        // 更新上一帧时间
        lastFrameTime = currentTime;
        requestAnimationFrame(animate);
    }

    requestAnimationFrame(animate);

</script>